@import url('https://fonts.googleapis.com/css2?family=K2D:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');

.carousel-control-prev:hover, .carousel-control-next:hover {
    background-color: #424242;
}

.container{
    display: block;
}

.car-card {
    background: white;
    /* border-radius: 10px; */
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 1em 0em;
}

.image-slider img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.car-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 2em;
}

.car-info h2 {
    font-size: 1.6rem;
    font-family: 'K2D', sans-serif;
    font-weight: 700;
    margin: 0;
}

.car-info h3 {
    font-size: 1.2rem;
    font-family: 'K2D', sans-serif;
    font-weight: 700;
    margin: 0;
}


.full-name {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-family: 'K2D', sans-serif;

}

.details {
    display: flex;
    justify-content: space-between;
    color: #424242;
    font-family: 'roboto condensed', sans-serif;
    margin-top: 5px;
}

.details p {
    margin: 4px 0;
}

.description {
    font-size: 0.85rem;
    color: #555;
    margin: 10px 0;
    min-height: 50px;
}

.price-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #005f4f;
    color: white;
    padding: 8px 12px;
    /* border-radius: 5px 0 0 5px; */
    font-weight: bold;
    font-family: "K2D", sans-serif;
    font-size: 1.5rem;
    -webkit-clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

.info-button {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 12px 0;
    margin-top: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;

    font-family: "K2D", sans-serif;
    text-transform: uppercase;
}

.info-button:hover {
    background: #005f4f;
}

/* slider */
.carousel img {
    width: 400px;
    height: 400px;
    object-fit: cover;
}

.stat {
    width: 30px;
    height: 30px;
    margin-right: 6px;
    vertical-align: middle;
    filter: invert(21%) sepia(8%) saturate(19%) hue-rotate(331deg) brightness(94%) contrast(80%);
}

/* Desktop layout: make card wider with left image and right details */
@media (min-width: 1400px) {

    .stat {
        width: 25px;
        height: 25px;
    }

    .car-card {
        flex-direction: row;
        width: 100%;
        max-width: 1300px;
        height: 400px;
        margin-left: 2em;
        margin-top: 0;
    }

    /* left: image container */
    .car-card .carousel {
        flex: 0 0 400px;
        max-width: 400px;
        position: relative;
        height: 336px;
        overflow: hidden;
    }

    /* right: info column */
    .car-card .car-info {
        flex: 1 1 52%;
        max-width: 52%;
        padding: 24px 28px 100px 28px; /* leave room for bottom bar */
        box-sizing: border-box;
    }

    .price-tag {
        font-size: 1.5em;
        top: 16px;
        right: 18px;
        background: #005f4f;
        color: white;
        padding: 12px 22px;
        font-weight: 700;
        border-radius: 0;
        line-height: 1;
        position: absolute;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /* slanted left edge to match mockup (parallelogram) */
        -webkit-clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
        clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    }


    /* bottom full-width info button */
    .car-card .info-button {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        margin: 0;
        border-radius: 0;
        padding-left: 28px;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        font-size: 1.05rem;
    }

    /* green arrow box on the right of the info button */
    .car-card .info-button::after {
        content: '>'; /* right arrow */
        position: absolute;
        right: 0;
        top: 0;
        width: 64px;
        height: 100%;
        background: #005f4f;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.6rem;
        line-height: 1;
    }

    /* adjust description height to avoid overlap */
    .car-card .description { min-height: 60px; }

}

/* Remove left margin on smaller screens so the card stacks cleanly */
@media (max-width: 1399.98px) {
    .car-info {
        margin-left: 0;
    }
}

/* Grid layout for cards on smaller screens */
@media (max-width: 1399.98px) {
    .car-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        align-items: start;
    }

    .car-card {
        width: 100%;
        margin-left: 0;
    }
}

/* Stack and center stats on small screens: icon above label, value under label */
@media (max-width: 1399.98px) {
    /* Use a two-row grid: grid-auto-flow column fills top-to-bottom then left-to-right
       This makes the stats form exactly two rows on small screens. We use
       display:contents on the .left/.right wrappers so their <p> children
       participate directly in the grid. */
    .details {
        display: grid;
        grid-template-rows: repeat(2, auto);
        grid-auto-flow: column;
        grid-auto-columns: minmax(90px, 1fr);
        gap: 12px 18px;
        justify-content: center;
        align-items: start;
        width: 100%;
        box-sizing: border-box;
    }

    /* allow the inner <p> elements to be direct grid items */
    .details .left,
    .details .right {
        display: contents;
    }

    /* each stat becomes a vertical, centered block */
    .details p {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 6px 0;
        padding: 6px 4px;
    }

    /* icon above the label */
    .details p .stat {
        margin-right: 0;
        margin-bottom: 8px;
        width: 35px;
        height: 35px;
    }

    /* make the label appear on its own line above the value */
    .details p strong {
        display: block;
        margin: 0 0 6px 0;
        font-weight: 700;
    }

}

.box {
    padding: 1em;
}